package com.example.quiz;

import Mis_clases.MyDialog;
import android.os.Bundle;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class VentanaPrincipal extends FragmentActivity {

	protected Button customFont;
	protected MyDialog dialog;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ventana_principal);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	//Mostramos el submenu al pulsar la tecla menu
    	MenuInflater inflater = getMenuInflater(); 
    	inflater.inflate(R.menu.activity_ventana_principal, menu);
    	return true;
    }
    
    public void launchVentanaPuntuaciones(View view) { 
    	startActivity(new Intent(VentanaPrincipal.this, VentanaPuntuaciones.class));
    }
    
    public void launchVentanaPropiedades(View view) { 
    	startActivity(new Intent(VentanaPrincipal.this, VentanaPropiedades.class));
    }
    
    public void launchVentanaJuego(View view) { 
    	startActivity(new Intent(VentanaPrincipal.this, VentanaJuego.class));
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item){
    	dialog = new MyDialog();
    	
    	switch(item.getItemId()){
    		case R.id.options1:
    			dialog.show(getSupportFragmentManager(), null);
    			return true;
    		default:
    			return true;	
    	}
    }
}
